﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SharpSoft.Geometries.Structs
{
    public struct Rect
    {
        /// <summary>
        /// 表示矩形X方向的宽度
        /// </summary>
        public double Width { get; set; }
        /// <summary>
        /// 表示矩形Y方向的高度
        /// </summary>
        public double Height { get; set; }
        /// <summary>
        /// 获取对角线长度
        /// </summary>
        public double DiagonalLength
        {
            get
            {
                return Math.Sqrt(Width.Pow() + Height.Pow());
            }
        }
        /// <summary>
        /// 获取对角线与X方向宽度的夹角
        /// </summary>
        public Radian DiagonalAngle
        {
            get
            {
                return (Radian)Math.Atan2(this.Height, this.Width);
            }
        }
    }
}
